@echo off
set PkgName=AliensKFWeapons
set KFPath=C:\Program Files (x86)\Steam\steamapps\common\killingfloor\

:: Remove any existing scripts from the package directory
del "%KFPath%%PkgName%\*.uc" /S /Q

:: Remove compiled package file (.u)
if exist "%KFPath%System\%PkgName%.u" del "%KFPath%System\%PkgName%.u" /Q

:: Copy scripts to package directory
XCOPY "Classes\*.uc" "%KFPath%%PkgName%\Classes" /D /E /C /R /I /K /Y

:: Compile
"%KFPath%System\UCC.exe" make
if errorlevel 1 goto FailedCompile

:: Delete steam_appid file (file causes networking problems)
if exist "%KFPath%System\steam_appid.txt" del "%KFPath%System\steam_appid.txt" /Q

:: Compile complete, exit batch file
ECHO
exit

:: Compile failed, let user see error before exiting
:FailedCompile
pause
